Imports System.Windows.Forms

Public Class frmToolsOptions

    Public Sub New()
        ' This call is required by the Windows Form Designer.
        InitializeComponent()
        ' Add any initialization after the InitializeComponent() call.
        Dim i As Integer
        For i = 1 To ClassCompilerSetup.compilerType.LAST - 1
            ComboBox1.Items.Add(ClassCompilerSetup.assemblerDesc(i - 1))
        Next
        If My.Settings.assemblerSelected Then
            ComboBox1.SelectedIndex = My.Settings.assemblerSelected - 1
        End If
        Me.TextBoxNrOfSpacesForTab.Text = MainForm._editorSettings.IndentationSize
    End Sub
    Private Sub OK_Button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OK_Button.Click

        My.Settings.assemblerSelected = ComboBox1.SelectedIndex + 1
        MainForm._editorSettings.IndentationSize = Me.TextBoxNrOfSpacesForTab.Text
        Me.DialogResult = System.Windows.Forms.DialogResult.OK
        Me.Close()
    End Sub

    Private Sub Cancel_Button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Cancel_Button.Click
        Me.DialogResult = System.Windows.Forms.DialogResult.Cancel
        Me.Close()
    End Sub

    Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) _
        Handles ComboBox1.SelectedIndexChanged


    End Sub

    Private Sub frmToolsOptions_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    End Sub

    Private Sub ButtonBrowseForEmuExe_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonBrowseForEmuExe.Click
        Dim ofd As OpenFileDialog = New OpenFileDialog
        If ofd.ShowDialog = Windows.Forms.DialogResult.OK Then
            TextBoxEmuExe.Text = ofd.FileName
            My.Settings.emulatorExe = TextBoxEmuExe.Text
        End If
    End Sub

    Private Sub TextBoxEmuExe_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBoxEmuExe.TextChanged
        My.Settings.emulatorExe = TextBoxEmuExe.Text
    End Sub

    Private Sub ButtonPreBuildStep_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonPreBuildStep.Click
        Dim ofd As OpenFileDialog = New OpenFileDialog
        If ofd.ShowDialog = Windows.Forms.DialogResult.OK Then
            TextBoxPrebuildStep.Text = ofd.FileName
            My.Settings.prebuildBatchFile = TextBoxPrebuildStep.Text
        End If
    End Sub

    Private Sub TextBoxPrebuildStep_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBoxPrebuildStep.TextChanged
        My.Settings.prebuildBatchFile = TextBoxPrebuildStep.Text
    End Sub

    Private Sub ButtonPostBuildStep_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonPostBuildStep.Click
        Dim ofd As OpenFileDialog = New OpenFileDialog
        If ofd.ShowDialog = Windows.Forms.DialogResult.OK Then
            TextBoxPostBuildStep.Text = ofd.FileName
            My.Settings.postbuildBatchFile = TextBoxPostBuildStep.Text
        End If
    End Sub

    Private Sub TextBoxPostBuildStep_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBoxPostBuildStep.TextChanged
        My.Settings.postbuildBatchFile = TextBoxPostBuildStep.Text
    End Sub

    Private Sub TextBoxPrebuildStep_VisibleChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBoxPrebuildStep.VisibleChanged
        TextBoxPrebuildStep.Text = My.Settings.prebuildBatchFile
    End Sub

    Private Sub TextBoxEmuExe_VisibleChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBoxEmuExe.VisibleChanged
        TextBoxEmuExe.Text = My.Settings.emulatorExe
    End Sub
End Class
